// exports.AL_Framework_Update = void 0;
// (function (e) {
//     var t;
//     var o;
//     var i;
//     e.MAIN_PACK = "main";
//     e.GAME_HOME_PACK = "GameHome";
//     e.MANIFEST_ROOT = "manifest/";
//     (i = e.Code || (e.Code = {}))[(i.ERROR_NO_LOCAL_MANIFEST = 0)] = "ERROR_NO_LOCAL_MANIFEST";
//     i[(i.ERROR_DOWNLOAD_MANIFEST = 1)] = "ERROR_DOWNLOAD_MANIFEST";
//     i[(i.ERROR_PARSE_MANIFEST = 2)] = "ERROR_PARSE_MANIFEST";
//     i[(i.NEW_VERSION_FOUND = 3)] = "NEW_VERSION_FOUND";
//     i[(i.ALREADY_UP_TO_DATE = 4)] = "ALREADY_UP_TO_DATE";
//     i[(i.UPDATE_PROGRESSION = 5)] = "UPDATE_PROGRESSION";
//     i[(i.ASSET_UPDATED = 6)] = "ASSET_UPDATED";
//     i[(i.ERROR_UPDATING = 7)] = "ERROR_UPDATING";
//     i[(i.UPDATE_FINISHED = 8)] = "UPDATE_FINISHED";
//     i[(i.UPDATE_FAILED = 9)] = "UPDATE_FAILED";
//     i[(i.ERROR_DECOMPRESS = 10)] = "ERROR_DECOMPRESS";
//     i[(i.MAIN_PACK_NEED_UPDATE = 11)] = "MAIN_PACK_NEED_UPDATE";
//     i[(i.PRE_VERSIONS_NOT_FOUND = 12)] = "PRE_VERSIONS_NOT_FOUND";
//     i[(i.UNINITED = 13)] = "UNINITED";
//     (o = e.State || (e.State = {}))[(o.UNINITED = 0)] = "UNINITED";
//     o[(o.UNCHECKED = 1)] = "UNCHECKED";
//     o[(o.PREDOWNLOAD_VERSION = 2)] = "PREDOWNLOAD_VERSION";
//     o[(o.DOWNLOADING_VERSION = 3)] = "DOWNLOADING_VERSION";
//     o[(o.VERSION_LOADED = 4)] = "VERSION_LOADED";
//     o[(o.PREDOWNLOAD_MANIFEST = 5)] = "PREDOWNLOAD_MANIFEST";
//     o[(o.DOWNLOADING_MANIFEST = 6)] = "DOWNLOADING_MANIFEST";
//     o[(o.MANIFEST_LOADED = 7)] = "MANIFEST_LOADED";
//     o[(o.NEED_UPDATE = 8)] = "NEED_UPDATE";
//     o[(o.READY_TO_UPDATE = 9)] = "READY_TO_UPDATE";
//     o[(o.UPDATING = 10)] = "UPDATING";
//     o[(o.UNZIPPING = 11)] = "UNZIPPING";
//     o[(o.UP_TO_DATE = 12)] = "UP_TO_DATE";
//     o[(o.FAIL_TO_UPDATE = 13)] = "FAIL_TO_UPDATE";
//     o[(o.TRY_DOWNLOAD_FAILED_ASSETS = 14)] = "TRY_DOWNLOAD_FAILED_ASSETS";
//     (t = e.Status || (e.Status = {}))[(t.NEED_DOWNLOAD = 0)] = "NEED_DOWNLOAD";
//     t[(t.UP_TO_DATE = 1)] = "UP_TO_DATE";
//     t[(t.NEED_UPDATE = 2)] = "NEED_UPDATE";
//     var n = (function () {
//         function e(e) {
//             this.code = -1;
//             this.name = "";
//             this.manager = null;
//             this.name = e;
//         }
//         e.prototype.reset = function () {
//             this.manager.reset();
//         };
//         return e;
//     })();
//     e.AssetsManager = n;
// })(exports.AL_Framework_Update || (exports.AL_Framework_Update = {}));

/**
 * AL_Framework_Update 模块
 * 包含更新相关的常量、状态枚举及 AssetsManager 类。
 */
const AL_Framework_Update = {};

/** 主包名 */
AL_Framework_Update.MAIN_PACK = "main";

/** 游戏主页包名 */
AL_Framework_Update.GAME_HOME_PACK = "GameHome";

/** 清单文件根目录 */
AL_Framework_Update.MANIFEST_ROOT = "manifest/";

/**
 * Code 枚举
 * 定义了各种更新流程中的状态码及含义。
 */
AL_Framework_Update.Code = {
    ERROR_NO_LOCAL_MANIFEST: 0,          // 本地未找到清单文件
    ERROR_DOWNLOAD_MANIFEST: 1,         // 下载清单文件失败
    ERROR_PARSE_MANIFEST: 2,            // 解析清单文件失败
    NEW_VERSION_FOUND: 3,               // 发现新版本
    ALREADY_UP_TO_DATE: 4,              // 已是最新版本
    UPDATE_PROGRESSION: 5,              // 更新进度
    ASSET_UPDATED: 6,                   // 资源已更新
    ERROR_UPDATING: 7,                  // 更新错误
    UPDATE_FINISHED: 8,                 // 更新完成
    UPDATE_FAILED: 9,                   // 更新失败
    ERROR_DECOMPRESS: 10,               // 解压错误
    MAIN_PACK_NEED_UPDATE: 11,          // 主包需要更新
    PRE_VERSIONS_NOT_FOUND: 12,         // 未找到前置版本
    UNINITED: 13                        // 未初始化
};

/**
 * State 枚举
 * 定义了更新流程中的各种状态。
 */
AL_Framework_Update.State = {
    UNINITED: 0,                        // 未初始化
    UNCHECKED: 1,                       // 未检查
    PREDOWNLOAD_VERSION: 2,             // 准备下载版本信息
    DOWNLOADING_VERSION: 3,             // 正在下载版本信息
    VERSION_LOADED: 4,                  // 版本信息已加载
    PREDOWNLOAD_MANIFEST: 5,            // 准备下载清单
    DOWNLOADING_MANIFEST: 6,            // 正在下载清单
    MANIFEST_LOADED: 7,                 // 清单已加载
    NEED_UPDATE: 8,                     // 需要更新
    READY_TO_UPDATE: 9,                 // 准备更新
    UPDATING: 10,                       // 正在更新
    UNZIPPING: 11,                      // 正在解压
    UP_TO_DATE: 12,                     // 已更新到最新版本
    FAIL_TO_UPDATE: 13,                 // 更新失败
    TRY_DOWNLOAD_FAILED_ASSETS: 14      // 尝试重新下载失败的资源
};

/**
 * Status 枚举
 * 定义了资源的更新状态。
 */
AL_Framework_Update.Status = {
    NEED_DOWNLOAD: 0,                   // 需要下载
    UP_TO_DATE: 1,                      // 已更新到最新
    NEED_UPDATE: 2                      // 需要更新
};

/**
 * AssetsManager 类
 * 用于管理资源的更新操作。
 */
class AssetsManager {
    /**
     * 构造函数
     * @param {string} name - 资源管理器的名称
     */
    constructor(name) {
        /** @type {number} 状态码 */
        this.code = -1;

        /** @type {string} 名称 */
        this.name = name;

        /** @type {any} 管理器实例 */
        this.manager = null;
    }

    /**
     * 重置资源管理器
     */
    reset() {
        if (this.manager) {
            this.manager.reset();
        }
    }
}

// 将 AssetsManager 类挂载到 AL_Framework_Update 模块
AL_Framework_Update.AssetsManager = AssetsManager;

// 导出 AL_Framework_Update 模块
exports.AL_Framework_Update = AL_Framework_Update;

// exports.AL_Framework_Update = void 0;

// /**
//  * @description AL_Framework_Update module for handling game updates, states, and statuses.
//  * @namespace AL_Framework_Update
//  */
// (function (AL_Framework_Update) {
//     /**
//      * @description Main package name
//      * @type {string}
//      */
//     AL_Framework_Update.MAIN_PACK = "main";

//     /**
//      * @description Game home package name
//      * @type {string}
//      */
//     AL_Framework_Update.GAME_HOME_PACK = "GameHome";

//     /**
//      * @description Root directory for manifests
//      * @type {string}
//      */
//     AL_Framework_Update.MANIFEST_ROOT = "manifest/";

//     /**
//      * @description Enumeration for update codes
//      * @enum {number}
//      */
//     AL_Framework_Update.Code = {
//         ERROR_NO_LOCAL_MANIFEST: 0,
//         ERROR_DOWNLOAD_MANIFEST: 1,
//         ERROR_PARSE_MANIFEST: 2,
//         NEW_VERSION_FOUND: 3,
//         ALREADY_UP_TO_DATE: 4,
//         UPDATE_PROGRESSION: 5,
//         ASSET_UPDATED: 6,
//         ERROR_UPDATING: 7,
//         UPDATE_FINISHED: 8,
//         UPDATE_FAILED: 9,
//         ERROR_DECOMPRESS: 10,
//         MAIN_PACK_NEED_UPDATE: 11,
//         PRE_VERSIONS_NOT_FOUND: 12,
//         UNINITED: 13
//     };

//     /**
//      * @description Enumeration for update states
//      * @enum {number}
//      */
//     AL_Framework_Update.State = {
//         UNINITED: 0,
//         UNCHECKED: 1,
//         PREDOWNLOAD_VERSION: 2,
//         DOWNLOADING_VERSION: 3,
//         VERSION_LOADED: 4,
//         PREDOWNLOAD_MANIFEST: 5,
//         DOWNLOADING_MANIFEST: 6,
//         MANIFEST_LOADED: 7,
//         NEED_UPDATE: 8,
//         READY_TO_UPDATE: 9,
//         UPDATING: 10,
//         UNZIPPING: 11,
//         UP_TO_DATE: 12,
//         FAIL_TO_UPDATE: 13,
//         TRY_DOWNLOAD_FAILED_ASSETS: 14
//     };

//     /**
//      * @description Enumeration for update statuses
//      * @enum {number}
//      */
//     AL_Framework_Update.Status = {
//         NEED_DOWNLOAD: 0,
//         UP_TO_DATE: 1,
//         NEED_UPDATE: 2
//     };

//     /**
//      * @class
//      * @description Class representing an asset manager.
//      * @param {string} name - The name of the asset manager.
//      */
//     class AssetsManager {
//         constructor(name) {
//             this.code = -1;
//             this.name = name;
//             this.manager = null;
//         }

//         /**
//          * @description Resets the asset manager.
//          */
//         reset() {
//             this.manager.reset();
//         }
//     }

//     AL_Framework_Update.AssetsManager = AssetsManager;

// })(exports.AL_Framework_Update || (exports.AL_Framework_Update = {}));
